//
//  Comment.m
//  初稿
//
//  Created by lanou3g on 15/7/18.
//  Copyright (c) 2015年 多飞科技. All rights reserved.
//

#import "Comment.h"

@implementation Comment


//@property(nonatomic,retain)NSString *comment_id;
//@property(nonatomic,retain)NSString *post_id;
//@property(nonatomic,retain)NSString *comment_time;
//@property(nonatomic,retain)NSString *reply_count;
//@property(nonatomic,retain)NSString *praise_count;

-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
    if ([key isEqualToString:@"comment_id"]) {
        
        _comment_idSB = [NSString stringWithFormat:@"%@",value];
        
    }
    
    if ([key isEqualToString:@"post_id"]) {
        _post_idSB = [NSString stringWithFormat:@"%@",value];
    }
    
    if ([key isEqualToString:@"reply_count"]) {
        _reply_countSB = [NSString stringWithFormat:@"%@",value];
    }
    if ([key isEqualToString:@"praise_count"]) {
        
        _praise_countSB = [NSString stringWithFormat:@"%@",value];
    }
    
    if ([key isEqualToString:@"storey"]) {
        
        _storeySB = [NSString stringWithFormat:@"%@",value];
    }
    
    
    
    if ([key isEqualToString:@"comment_time"]) {
//        这里的(float)[value floatValue]这块固定要用float类型；
        NSDate *nd=[NSDate dateWithTimeIntervalSince1970:(float)[value floatValue]];
        NSDateFormatter *dateFormatter=[[NSDateFormatter alloc]init];
        [dateFormatter setDateFormat:@"MM-dd  HH:mm"];
        NSString *dateStr=[dateFormatter stringFromDate:nd];
        _comment_timeSB = dateStr;
    }
}





-(NSMutableArray *)replyArray{
    if (_replyArray==nil) {
        _replyArray=[NSMutableArray array];
        
    }
    return _replyArray;
}



@end
